#!usr/bin/node

const http = require('http'),
      url = require('url'),
      msg = process.argv[2] || 'usr=banana\n',
      address = 'http://localhost:8080';

const opt = url.parse(global.encodeURI(address));
opt.method = 'POST';

const req = http.request(opt,(res) => {
  console.log(`HTTP/${res.httpVersion} ${res.statusCode} ${res.statusMessage}`);
  console.log(res.headers);
  res.pipe(process.stdout);
});

req.end(msg);
